const express = require('express');
const { routeWrapper } = require('../../../lib/module/tool/route');
const router = express.Router();

const promoteService = require('../../../lib/service/promoteService');

// 查询是否存在绑定关系
router.get('/:userId/getPromoteExist', routeWrapper(async (req, res, next) => {
    return promoteService.getPromoteUserInfo(req.params.userId);
}, true));

// 修改绑定关系
router.post('/changePromote', routeWrapper(async (req, res, next) => {
    return promoteService.changePromote(req.body.promoterId,req.body.customId);
}, true));

module.exports = router;
